package org.nepu.scr.indexrate.converter.riskrate.equipmentrisk;

import cn.hutool.json.JSONUtil;
import org.nepu.scr.indexrate.vo.riskrate.equipmentrisk.WellFrameB221;

import javax.persistence.AttributeConverter;
import javax.persistence.Convert;

@Convert
public class WellFrameB221Converter implements AttributeConverter<WellFrameB221, String> {
    @Override
    public String convertToDatabaseColumn(WellFrameB221 wellFrameB221) {
        return JSONUtil.toJsonStr(wellFrameB221);
    }

    @Override
    public WellFrameB221 convertToEntityAttribute(String s) {
        return JSONUtil.toBean(s, WellFrameB221.class);
    }
}
